//
//  AnnouncementDdetailsViewController.m
//  PlayerWorld
//
//  Created by 1 on 16/5/4.
//  Copyright © 2016年 刘成. All rights reserved.
//
#define UISCREEN_WIDTH  [UIScreen mainScreen].bounds.size.width
#define UISCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height

#import "AnnouncementDdetailsViewController.h"
#import "AnnouncementmaiModel.h"
@interface AnnouncementDdetailsViewController ()<UITextViewDelegate>

@end

@implementation AnnouncementDdetailsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"公告详情";
    self.view.backgroundColor = [UIColor groupTableViewBackgroundColor];
    
    // 状态栏(statusbar)
    CGRect rectStatus = [[UIApplication sharedApplication] statusBarFrame];
    
    // 导航栏（navigationbar）
    CGRect rectNav = self.navigationController.navigationBar.frame;

    UIView * announcementDetailsView = [[UIView alloc]initWithFrame:CGRectMake(0, rectStatus.size.height+rectNav.size.height, UISCREEN_WIDTH, 70)];
    announcementDetailsView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:announcementDetailsView];

    UIImageView *announcementDetailsImageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, 60, 60)];
    announcementDetailsImageView.image = [UIImage imageNamed:@"icon_date.png"];
    [announcementDetailsView addSubview:announcementDetailsImageView];


    UILabel *announcementDetailsLabel1 = [[UILabel alloc]initWithFrame:CGRectMake((60-42)/2+10, 10, 42, 17)];
    announcementDetailsLabel1.text = [NSString stringWithFormat:@"%@",[self.model.W_M_AddTime substringWithRange:NSMakeRange(5, 2)]];
    announcementDetailsLabel1.font = [UIFont systemFontOfSize:12];
    announcementDetailsLabel1.textColor = [UIColor whiteColor];
    announcementDetailsLabel1.textAlignment = NSTextAlignmentCenter;
    [announcementDetailsView addSubview:announcementDetailsLabel1];

    UILabel *announcementDetailsLabel2 = [[UILabel alloc]initWithFrame:CGRectMake((60-42)/2+10, 18, 42, 52)];
    announcementDetailsLabel2.text = [NSString stringWithFormat:@"%@",[self.model.W_M_AddTime substringWithRange:NSMakeRange(8, 2)]];
    announcementDetailsLabel2.font = [UIFont systemFontOfSize:20];
    announcementDetailsLabel2.textColor = [UIColor blackColor];
    announcementDetailsLabel2.textAlignment = NSTextAlignmentCenter;
    [announcementDetailsView addSubview:announcementDetailsLabel2];

    UILabel *announcementDetailsLabel3 = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(announcementDetailsImageView.frame)+16, (70-43)/2, UISCREEN_WIDTH-CGRectGetMaxX(announcementDetailsImageView.frame)-16-10, 43)];
    announcementDetailsLabel3.text = self.model.W_M_Title;
    announcementDetailsLabel3.font = [UIFont systemFontOfSize:17];
    announcementDetailsLabel3.textColor = [UIColor blackColor];
    announcementDetailsLabel3.textAlignment = NSTextAlignmentLeft;
    announcementDetailsLabel3.numberOfLines = 0;
    [announcementDetailsView addSubview:announcementDetailsLabel3];


    UIWebView *announcementDetailstextView = [[UIWebView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(announcementDetailsView.frame)+1, UISCREEN_WIDTH, UISCREEN_HEIGHT-CGRectGetMaxY(announcementDetailsView.frame)-1)];
    announcementDetailstextView.scrollView.bounces=NO;
    [announcementDetailstextView loadHTMLString:self.model.W_M_Content baseURL:nil];
    [self.view addSubview:announcementDetailstextView];//加入到页面中


}


@end
